package main

import (
	"fmt"
	"reflect"
	"sync"
)

type S struct {
	
}
type T struct {
	S
}

func (S) svVal()  {
	
}
func (*S)sPtr()  {

}

func (T) tVal()  {

}
func (*T) tPtr()  {

}

func methodSet(a interface{})  {
	t := reflect.TypeOf(a)
	for i,n := 0,t.NumMethod();i <n ;i++ {
		m := t.Method(i)
		fmt.Println(m.Name,m.Type)
	}
}

type N int

func (n N) test()  {
	fmt.Printf("test.n: %p, %d \n",&n,n)
}

func main() {
	var mu sync.Mutex
	var wg sync.WaitGroup
	wg.Add(10)
	m :=0
	mu.Lock()
	for i:= 0;i<200;i++ {
		m++
	}
	mu.Unlock()
	var t T
	methodSet(t)
	println("--------------------")
	methodSet(&t)

	var n N = 5
	fmt.Printf("main.n: %p, %d \n",&n,n)
	f1 := N.test
	f1(n)

	f2 := (*N).test
	f2(&n)

	N.test(n)
	(*N).test(&n)
}